/**
 * Created by yuris on 16.02.15.
 */
package model {
import messages.ModelToViewMessage;

import mvcexpress.mvc.Proxy;

public class LocalizationProxy extends Proxy {

    private var _localization:Object;

    override protected function onRegister():void {

    }

    override protected function onRemove():void {

    }

    public function getLocale(branch:String, key:String):String {
        if(this._localization && this._localization[branch] && this._localization[branch][key]){
            return this._localization[branch][key];
        }
        return branch+":"+key;
    }

    public function set localization(value:Object):void {
        this._localization = value;
        sendMessage(ModelToViewMessage.LOCALIZATION_INIT_COMPLETE, this);
    }
}
}
